home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / absadr.arc / ABSADR.DOC next >
Text File  |  1991-08-16  |  3KB  |  88 lines

  1. ABSADR v1.0 Absolute address calcluations.
  2. Copyright (c) 1991 Thomas M. Peters
  3.  
  4. Purpose: Given any two of segment, offset, or absolute addresses, 
  5. calculate the third value.
  6.  
  7. Usage:
  8.  
  9. Enter ABSADR at the command line. The program will prompt you for 
  10. three values. You must enter TWO of them. Press ENTER only, not a 
  11. zero, for the unknown parameter. ABSADR then calculates the third 
  12. value and displays the entire address in the form:
  13.  
  14. ssss:oooo = aaaaaaa
  15.  
  16. ssss = segment
  17. oooo = offset
  18. aaaaaa = absolute
  19.  
  20. Limitations:
  21.  
  22. ABSADR is written in Microsoft C, a language I rarely use, and 
  23. therefore has no elaborate error checking. It is meant to be a simple 
  24. programming aid and as such, has certain limitations.
  25.  
  26. 1. It is easy to specify a segment and offset that form an absolute 
  27. address beyond the addressing capacity of IBM-PC compatible machines. 
  28. No checking is done for this, and though the answer given by ABSADR is 
  29. valid, it is probably inapplicable.
  30.  
  31. 2. It is likewise not hard to enter a segment and absolute address for 
  32. which no offset can reach. CHECK YOUR RESULTS! Segment and offset 
  33. addresses must both lie in the range of 0000h to FFFFh. If you get a 
  34. segment or offset from ABSADR that is more than four digits, the 
  35. problem cannot be solved as you have entered it.
  36.  
  37. The only way ABSADR signals this situation is to output an address 
  38. more than four digits long in the segment or offset fields.
  39.  
  40. One way to check the results is to feed the output values back into 
  41. the program and check the answer.
  42.  
  43. 3. Very little input value range checking is done. ABSADR will try to 
  44. make sense of nearly anything you enter, with no guarantee that the 
  45. results will mean anything. About all it does is complain if the 
  46. number of parameters input was not two. 
  47.  
  48. Internals:
  49.  
  50. The segment, offset, and absolute addresses are stored internally as C 
  51. "long integers" and all calculations are done using longs. The hex 
  52. conversion is done only on input and output.
  53.  
  54. Background: The iapx-86 family (8086, 8088, 80186, 80286, etc) of 
  55. microprocessors began as 16-bit address bus chips. This limited the 
  56. amount of memory they could reach to 2 to the 16th power, or 65535 
  57. (64k).  To widen the address space of such machines, a two part memory 
  58. addressing scheme was used. One value is used to specify which 64k 
  59. segment to use, the other specifies where in that segment to find the 
  60. data required.
  61.  
  62. To address more memory, the IBM-PC and her clones multiply the segment 
  63. address by 16 (10h) before using it.
  64.  
  65. To find out what particular address a given segment:offset pair 
  66. specifies, one can multiply the segment value by 16 (10h) and simply
  67. add the offset. A similar process can be used to solve for segment or 
  68. offset, given the other two values. Example:
  69.  
  70. A000:0100 =        (segment:offset form)
  71. A000*10 + 0100 =
  72. A0000 + 0100 =
  73. A0100              (absolute form)
  74.  
  75. Copyrights:
  76.  
  77. ABSADR and accompaning documentation are copyrighted (c) 1991 by 
  78. Thomas M. Peters. Permission is hereby granted to reproduce it, 
  79. provided that all files are copied intact.
  80.  
  81. If you use ABSADR, please send $5 or more to the author at the address 
  82. following. If you send more than $8, I will send the commented C 
  83. source code on paper.
  84.  
  85. Thomas M. Peters
  86. 4517 N. Oakland Ave
  87. Milwaukee, WI  53211-1216
  88.